<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow: hidden">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${Title}</title>
<link rel="shortcut icon" href="${res}favicon.ico" type="image/x-icon" />
 <!--Basic Styles-->
<link href="../framework/css/font.css" rel="stylesheet" />
<link href="../framework/miniui/themes/material/miniui.css" rel="stylesheet" />
<link href="../framework/css/app.min.1.css" rel="stylesheet" type="text/css" />
<link href="../framework/css/app.min.2.css" rel="stylesheet" type="text/css" />
<script src="../framework/main.js" type="text/javascript"></script>
<style type="text/css">
    html, body{
        margin:0;padding:0;border:0;width:100%;height:100%;overflow:hidden;
    }    
    </style>
</head>
<body class="body-detail">
	<script>
	//
		Page.onLoad(function(){
			mini.get('dg1').load();	
		});
		function doSearch(){
			mini.get('dg1').load({RealName:mini.get("SearchUserName").getValue(),CompanyInfo:mini.get("CompanyInfo").getValue()});	
			}
		function gender(e) {
			if (e.record.Gender == 'M') {
				return "男";
			} else if (e.record.Gender == 'F') {
				return "女";
			}
		}
		
		 function action(e) {
			var record = e.record
			e.cellStyle = "text-align:left";
	        return '<a href="javascript:deleteUser(\'' + record.Member + '\','+record.Company+')">移除当前公司</a>';
		} 
		//删除用户
		  function deleteUser(Member, Company) {
			top.mini.confirm("确定要删除？",function(action){
				if(action == "ok"){
					Server.sendRequest("NewAccountNumber.deleteInformation",{MemberId:Member,Company:Company},function(response){
						if(response.Status == 1){
							top.mini.showTips({content:response.Message,state:'success'});
							mini.get('dg1').reload();
						}else{
							top.mini.warn(response.Message);
						}
					});
				}
			});
		}  
	</script>
	
	<div class="search-area">
		 <div class="pull-right">
		    <input class="mini-textbox" id="CompanyInfo" type="text" emptyText="请输入一级账号、机构名称"  style="margin-right: 20px;"/>
			<input class="mini-textbox" id="SearchUserName" type="text" emptyText="请输入真实姓名、账号"/>
		 	<button class="btn btn-default" id="Submitbutton" onClick="doSearch()"><i class="iconfont icon-search"></i></button>
		 </div>
	</div>
	
	<div class="mini-fit" style="padding:0 10px 10px 10px;">
		<div id="dg1" class="mini-datagrid z-depth-1" style="width:100%;height:100%;" method="NewAccountNumber.findSubAccount" idField="Member" multiSelect="true">
		    <div property="columns">
		       	<div type="indexcolumn"></div>
		       	<div field="Mobile" width="15%">账号</div>
		       	<div field="CompanyMobile" width="15%">所属一级账号</div>
		        <div field="EmployeeNumber" width="15%">机构名称</div>
	            <div field="RealName" width="15%">真实姓名</div>
	            <div field="Gender" renderer="gender" width="15%">性别</div>
	            <div field="Name" width="15%">所属部门</div>
	            <div name="action" renderer="action"  width="16%">操作</div>
		    </div>
		</div>
	</div>
	
</body>
</html>